precision mediump float; // 中精度浮点数

attribute vec2 u_position;
attribute vec2 uv;

uniform vec2 u_resolution;

varying vec2 vUV;
varying vec3 vPosition;
varying vec2 vResolution;
uniform vec2 u_ratio;

void main() {

    float ratio = u_resolution.x / u_resolution.y;
    //
    vUV = vec2(uv.x * u_resolution.x, uv.y * u_resolution.y);
    vUV /= 800.;
    vResolution = u_resolution;

    vPosition = vec3(u_position.x, 0., u_position.y);
    vec2 position = u_position / u_resolution;
    position.x /= u_ratio.x;
    position.y /= u_ratio.y;
    position *= 2.;
    position -= vec2(1.);
    position *= vec2(1., -1.);
    //    position.x *= ratio;

    gl_Position = vec4(position, 0., 1.);
}
